package com.thy.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hospital.common.dto.stat.module.DoctorStatDto;
import com.hospital.common.dto.stat.module.StatDto;
import com.hospital.common.pojo.TStat;
import com.hospital.common.vo.stat.module.DoctorStatVo;
import com.hospital.common.vo.stat.module.StatVo;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 统计表 Mapper 接口
 * </p>
 *
 * @author author
 * @since 2025-09-13
 */
public interface TStatMapper extends BaseMapper<TStat> {


    List<Map<String, Object>> getTotalRegistrations(@Param("statDto") StatDto statDto);

    List<Map<String, Object>> getCancellations(@Param("statDto") StatDto statDto);

    List<Map<String, Object>> getAiConsultCount(@Param("statDto")StatDto statDto);

    List<Map<String, Object>> getTotalConsultCount(@Param("statDto") StatDto statDto);

    List<Map<String, Object>> getAiDiagnosisAcceptancePct(@Param("statDto") StatDto statDto);

    List<Map<String, Object>> getComlaintsCount(@Param("statDto") StatDto statDto);

    List<Map<String, Object>> getMedicationCosts(@Param("statDto") StatDto statDto);

    List<Map<String, Object>> getConsultationFee(@Param("statDto") StatDto statDto);

    List<Map<String, Object>> getRegistrationFee(@Param("statDto") StatDto statDto);

    String getDepartmentNameById(@Param("departmentId") Long departmentId);

    void addStat(@Param("statVo") StatVo statVo);

    List<DoctorStatVo> getDoctorAndDepartmentByDepartmentId(@Param("departmentId") Long departmentId);


    Integer getTotalConsultCounts(@Param("doctorId") Long doctorId, @Param("doctorStatDto") DoctorStatDto doctorStatDto);

    Double getMedicationCostses(@Param("doctorStatDto") DoctorStatDto doctorStatDto,@Param("doctorId") Long doctorId);

    Double getConsultationFees(@Param("doctorStatDto") DoctorStatDto doctorStatDto,@Param("doctorId") Long doctorId);

    Double getRegistrationFees(@Param("doctorStatDto") DoctorStatDto doctorStatDto,@Param("doctorId") Long doctorId);

    Double getOnlineSatisfactionScore(@Param("doctorStatDto") DoctorStatDto doctorStatDto,@Param("doctorId") Long doctorId);

    Integer getNormalAttendance(@Param("doctorStatDto") DoctorStatDto doctorStatDto,@Param("doctorId") Long doctorId);

    Integer getTotalAttendance(@Param("doctorStatDto") DoctorStatDto doctorStatDto,@Param("doctorId") Long doctorId);

    void addDoctorStat(@Param("doctorStatVo") DoctorStatVo doctorStatVo);

    List<StatVo> getStat(@Param("month") LocalDateTime month);

    List<DoctorStatVo> getDoctorStat(@Param("month") LocalDateTime month,@Param("departmentId") Long departmentId);
}
